use std::collections::HashSet;

/**
 * 使用一个hashset就可以解决问题了
 */
pub fn new_count_distinct(input_str: &str) -> usize {
    let mut count: usize = 0;
    let mut set: HashSet<&str> = HashSet::new();
    for item in input_str.split(",").into_iter() {
        if !set.contains(item) {
            count = count + 1;
            set.insert(item);
        }
    }
    count
}
